package com.gofun.report.model;

import com.gofun.common.model.enums.CarStateEnum;
import com.gofun.common.util.DateUtil;
import com.gofun.common.util.StringUtils;

import java.util.Date;

public class CarInfoVo {
    private String carID;

    private String plateNum;

    private String carTypeID;

    private String cityCode;

    private String parkingIDs;

    private String toParkingIDs;

    private String state;

    private String stateDesc;

    private Date toParkingTime;

    private String toParkingTimeDesc;

    public String getCarID() {
        return carID;
    }

    public void setCarID(String carID) {
        this.carID = carID;
    }

    public String getPlateNum() {
        return plateNum;
    }

    public void setPlateNum(String plateNum) {
        this.plateNum = plateNum;
    }

    public String getCarTypeID() {
        return carTypeID;
    }

    public void setCarTypeID(String carTypeID) {
        this.carTypeID = carTypeID;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getParkingIDs() {
        return parkingIDs;
    }

    public void setParkingIDs(String parkingIDs) {
        this.parkingIDs = parkingIDs;
    }

    public String getToParkingIDs() {
        return toParkingIDs;
    }

    public void setToParkingIDs(String toParkingIDs) {
        this.toParkingIDs = toParkingIDs;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Date getToParkingTime() {
        return toParkingTime;
    }

    public String getToParkingTimeDesc() {

        if (toParkingTime != null) {
            return DateUtil.formatTime(toParkingTime);
        }

        return toParkingTimeDesc;
    }

    public void setToParkingTimeDesc(String toParkingTimeDesc) {
        this.toParkingTimeDesc = toParkingTimeDesc;
    }

    public String getStateDesc() {

        if (StringUtils.notNullOrBlank(state)) {
            return CarStateEnum.getTitle(state);
        }

        return stateDesc;
    }

    public void setStateDesc(String stateDesc) {
        this.stateDesc = stateDesc;
    }

    @Override
    public String toString() {
        return "CarInfoVo{" +
                "carID='" + carID + '\'' +
                ", plateNum='" + plateNum + '\'' +
                ", carTypeID='" + carTypeID + '\'' +
                ", cityCode='" + cityCode + '\'' +
                ", parkingIDs='" + parkingIDs + '\'' +
                ", toParkingIDs='" + toParkingIDs + '\'' +
                ", state='" + state + '\'' +
                ", stateDesc='" + stateDesc + '\'' +
                ", toParkingTime=" + toParkingTime +
                ", toParkingTimeDesc='" + toParkingTimeDesc + '\'' +
                '}';
    }
}
